import math
a,b,phi=(input("Please input length_1, length_2, angle (in degrees) separated with \", \": ").split(", "));
a=float(a);
b=float(b);
phi=float(phi);
phi_rad=phi*math.pi/180.0;
print("length_3 = {:.4f}".format(math.sqrt(a**2+b**2-2*a*b*math.cos(phi_rad))));